package tp.pr5.mv.command;

import tp.pr5.mv.CPU;
import tp.pr5.mv.Memory;
import tp.pr5.mv.OperandStack;
import tp.pr5.mv.ProgramCounter;

public class QUIT extends Command {

	public boolean executeCommand(Memory mem, OperandStack stack, ProgramCounter pc,  CPU cpu) {
		
		cpu.halt(); // Paramos la máquina virtual cambiando el valor del booleano stop a true
		return true;
		
	}
	
	public Command parse(String line) {
	
		if ( line.equalsIgnoreCase( "quit" ) ) return new QUIT(); // Parseamos si el comando introducido es quit
		else return null;
		
	}
	
}
